<html>
<head><meta charset="utf-8"><title>what mir-opts matter? · t-compiler/wg-mir-opt · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/index.html">t-compiler/wg-mir-opt</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html">what mir-opts matter?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="204649925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204649925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204649925">(Jul 22 2020 at 10:25)</a>:</h4>
<p>Writing optimizations is always fun, i love seeing test cases shrink but for rustc it seems like the real objective is to pre-chew MIR so that LLVM will have less to do. In that context, do we have any idea what actually matters? or are we just hoping that doing enough optimizations in rustc will cut down the emitted IR enough to make compilation faster?</p>
<p>Sorry if this has been answered but I didn't find anything on this in the compiler-team repo</p>



<a name="204649942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204649942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204649942">(Jul 22 2020 at 10:25)</a>:</h4>
<p>P.S. if there are more issues, I'd be happy to work on them</p>



<a name="204662366"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204662366" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204662366">(Jul 22 2020 at 13:06)</a>:</h4>
<p>well, we aren't just hoping, we're seeing this happening, but we don't have a structured approach for finding optimizations that will have an effect</p>



<a name="204662425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204662425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204662425">(Jul 22 2020 at 13:07)</a>:</h4>
<p>in some cases it's not even about llvm, but about shrinking MIR so later mir passes call fewer queries, which definitely has had an effect in the past</p>



<a name="204675064"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675064" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675064">(Jul 22 2020 at 14:43)</a>:</h4>
<p>i noticed that we don't currently do the optimizations described in Stacked Borrows and LLVM doesn't seem to pick up on them either. Is this something on the roadmap?  specifically thinking of things like <code>*x = 5; *y = 10; do_something_with_x(*x)</code></p>



<a name="204675172"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675172" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675172">(Jul 22 2020 at 14:44)</a>:</h4>
<p>ohh, that's very interesting if LLVM doesn't do that</p>



<a name="204675207"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675207" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675207">(Jul 22 2020 at 14:44)</a>:</h4>
<p><a href="https://rust.godbolt.org/z/s4od4W">https://rust.godbolt.org/z/s4od4W</a></p>



<a name="204675209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675209">(Jul 22 2020 at 14:45)</a>:</h4>
<p>do you have a playground link with that example?</p>



<a name="204675211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675211">(Jul 22 2020 at 14:45)</a>:</h4>
<p>oh</p>



<a name="204675214"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675214" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675214">(Jul 22 2020 at 14:45)</a>:</h4>
<p>nice</p>



<a name="204675248"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675248" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675248">(Jul 22 2020 at 14:45)</a>:</h4>
<p>Pretty sure that's just the <code>noalias</code> issue</p>



<a name="204675259"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675259" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675259">(Jul 22 2020 at 14:45)</a>:</h4>
<p>(PS: sometimes I use playgrounds because you can directly ask for the MIR output :D)</p>



<a name="204675274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675274">(Jul 22 2020 at 14:45)</a>:</h4>
<p>im guessing this case could be picked up by NRVO but it can be generalized as well</p>



<a name="204675310"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675310" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675310">(Jul 22 2020 at 14:45)</a>:</h4>
<p>yea but I wanted to see if LLVM was doing something clever afterwards</p>



<a name="204675379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675379">(Jul 22 2020 at 14:46)</a>:</h4>
<p>you need -Zmutable-noalias, yeah</p>



<a name="204675413"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675413" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675413">(Jul 22 2020 at 14:46)</a>:</h4>
<p>LLVM is buggy with it sometimes though which is why it's (still) off by default</p>



<a name="204675425"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675425" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675425">(Jul 22 2020 at 14:46)</a>:</h4>
<p>yeah, without noalias there's not much that can be done I reckon</p>



<a name="204675461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675461">(Jul 22 2020 at 14:46)</a>:</h4>
<p>so fwiw LLVM is working on this atm</p>



<a name="204675495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675495">(Jul 22 2020 at 14:46)</a>:</h4>
<p>some people in the community have picked up the slack there and have made a sorts of working group for noalias</p>



<a name="204675561"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675561" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675561">(Jul 22 2020 at 14:47)</a>:</h4>
<p>there are fortran folks there, which is super interesting. Fortran of course is one of the most prominent use cases for noalias, together with Rust</p>



<a name="204675575"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675575" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675575">(Jul 22 2020 at 14:47)</a>:</h4>
<p>imma send you links</p>



<a name="204675580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675580">(Jul 22 2020 at 14:47)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116122">simulacrum</span> <a href="#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/what.20mir-opts.20matter.3F/near/204675413">said</a>:</p>
<blockquote>
<p>LLVM is buggy with it sometimes though which is why it's (still) off by default</p>
</blockquote>
<p>that makes sense. i guess we could also do this in MIR though</p>



<a name="204675671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675671">(Jul 22 2020 at 14:48)</a>:</h4>
<p>Okay so they get together around once a month</p>



<a name="204675673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675673">(Jul 22 2020 at 14:48)</a>:</h4>
<p><a href="https://docs.google.com/document/d/1ybwEKDVtIbhIhK50qYtwKsL50K-NvB6LfuBsfepBZ9Y/edit#heading=h.vpxs8lkuxy79">https://docs.google.com/document/d/1ybwEKDVtIbhIhK50qYtwKsL50K-NvB6LfuBsfepBZ9Y/edit#heading=h.vpxs8lkuxy79</a></p>



<a name="204675703"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675703" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675703">(Jul 22 2020 at 14:48)</a>:</h4>
<p>that document tracks everything more or less</p>



<a name="204675730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675730">(Jul 22 2020 at 14:48)</a>:</h4>
<p>This doesn't look like a typical NRVO pattern</p>



<a name="204675737"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675737" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675737">(Jul 22 2020 at 14:48)</a>:</h4>
<p>you can scroll to see the details of every meeting</p>



<a name="204675748"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675748" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675748">(Jul 22 2020 at 14:48)</a>:</h4>
<p>one can join them as well</p>



<a name="204675964"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675964" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675964">(Jul 22 2020 at 14:50)</a>:</h4>
<p>If you look at the mailing list once a week you can find new posts regarding this: <a href="http://lists.llvm.org/pipermail/llvm-dev/2020-July/143388.html">http://lists.llvm.org/pipermail/llvm-dev/2020-July/143388.html</a> (that's the doodle poll for the last meeting, which happened about a week ago)</p>



<a name="204675993"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204675993" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204675993">(Jul 22 2020 at 14:50)</a>:</h4>
<p><span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> <a href="#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/what.20mir-opts.20matter.3F/near/204675730">said</a>:</p>
<blockquote>
<p>This doesn't look like a typical NRVO pattern</p>
</blockquote>
<p>that's what I thought but it is described as the first example in Stacked Borrows, so it seems like it should be valid for Rust</p>



<a name="204676044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676044">(Jul 22 2020 at 14:51)</a>:</h4>
<p>Anywho, I'm super excited for this work. Having noalias actually work in LLVM could bring Rust code beyond C performance in many, many use cases</p>



<a name="204676066"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676066" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676066">(Jul 22 2020 at 14:51)</a>:</h4>
<p>(just like Fortran! XD)</p>



<a name="204676236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676236">(Jul 22 2020 at 14:52)</a>:</h4>
<p>Yeah this is definitely optimizable, but not via NRVO</p>



<a name="204676257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676257">(Jul 22 2020 at 14:52)</a>:</h4>
<p><span class="user-mention silent" data-user-id="312719">Xavier Denis</span> <a href="#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/what.20mir-opts.20matter.3F/near/204675993">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="211727">Jonas Schievink</span> <a href="#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/what.20mir-opts.20matter.3F/near/204675730">said</a>:</p>
<blockquote>
<p>This doesn't look like a typical NRVO pattern</p>
</blockquote>
<p>that's what I thought but it is described as the first example in Stacked Borrows, so it seems like it should be valid for Rust</p>
</blockquote>
<p>It is! In fact if you think about it, Rust can guarantee lack of aliasing in like, most parts of all programs. Thanks to the borrow checker and all that</p>



<a name="204676359"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676359" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676359">(Jul 22 2020 at 14:53)</a>:</h4>
<p><span class="user-mention" data-user-id="212698">@Félix Fischer</span> yes but to justify the optimization we must also consider how <code>unsafe</code> code could potentially break it</p>



<a name="204676462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676462">(Jul 22 2020 at 14:54)</a>:</h4>
<p>It's just that we (re?)discovered a <code>noalias</code> optimization bug in LLVM with the amount of non aliasing pairs of references that can be created in Rust. And after that discovery, it was disabled in <code>rustc</code></p>



<a name="204676501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676501">(Jul 22 2020 at 14:54)</a>:</h4>
<p><span class="user-mention silent" data-user-id="312719">Xavier Denis</span> <a href="#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/what.20mir-opts.20matter.3F/near/204676359">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="212698">Félix Fischer</span> yes but to justify the optimization we must also consider how <code>unsafe</code> code could potentially break it</p>
</blockquote>
<p>ahhhh I see</p>



<a name="204676648"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676648" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676648">(Jul 22 2020 at 14:55)</a>:</h4>
<p>Okay since I don't know enough about this, and considering that we're already talking about Stacked Borrows, imma summon <span class="user-mention" data-user-id="120791">@RalfJ</span> to the conversation :3</p>



<a name="204676783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676783">(Jul 22 2020 at 14:56)</a>:</h4>
<p>He probably knows what we can do wrt <code>unsafe</code> here</p>



<a name="204676802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676802">(Jul 22 2020 at 14:56)</a>:</h4>
<p>there's no real need</p>



<a name="204676890"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676890" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676890">(Jul 22 2020 at 14:57)</a>:</h4>
<p>the paper already shows how this transformation is safe for programs that respect Stacked Borrows</p>



<a name="204676901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676901">(Jul 22 2020 at 14:57)</a>:</h4>
<p>But don't you mean that interior aliasing could break the optimization in unsafe code?</p>



<a name="204676903"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676903" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676903">(Jul 22 2020 at 14:57)</a>:</h4>
<p>oh</p>



<a name="204676910"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676910" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676910">(Jul 22 2020 at 14:57)</a>:</h4>
<p>OHHH</p>



<a name="204676926"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676926" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676926">(Jul 22 2020 at 14:57)</a>:</h4>
<p>omg, that is amazing</p>



<a name="204676945"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676945" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676945">(Jul 22 2020 at 14:57)</a>:</h4>
<p>holy crap</p>



<a name="204676947"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676947" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Xavier Denis <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676947">(Jul 22 2020 at 14:57)</a>:</h4>
<p>I was just curious if it we had implemented it / were implemnting it</p>



<a name="204676962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204676962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204676962">(Jul 22 2020 at 14:57)</a>:</h4>
<p>I see</p>



<a name="204677003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204677003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204677003">(Jul 22 2020 at 14:57)</a>:</h4>
<p>mmm... well I would honestly wait for LLVM to complete their move</p>



<a name="204677078"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204677078" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204677078">(Jul 22 2020 at 14:58)</a>:</h4>
<p>From what I've seen in that "working group", they have a lot of momentum</p>



<a name="204677215"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204677215" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204677215">(Jul 22 2020 at 14:59)</a>:</h4>
<p>but also I wonder if we can optimize some cases where LLVM could not, even if their <code>noalias</code> opt were sound</p>



<a name="204677231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204677231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204677231">(Jul 22 2020 at 14:59)</a>:</h4>
<p>do you reckon we can?</p>



<a name="204677313"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204677313" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204677313">(Jul 22 2020 at 14:59)</a>:</h4>
<p>(with regards to non-aliasing reference optimizations)</p>



<a name="204677506"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204677506" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204677506">(Jul 22 2020 at 15:01)</a>:</h4>
<p>I suspect one of the issues here is that while Stacked Borrows is a model of the borrowing system that has desirable properties, it's not the officially blessed one (yet).</p>



<a name="204677563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204677563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204677563">(Jul 22 2020 at 15:01)</a>:</h4>
<p><span class="user-mention" data-user-id="125250">@Wesley Wiser</span> because the official semantics haven't been defined (yet)?</p>



<a name="204677573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204677573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204677573">(Jul 22 2020 at 15:02)</a>:</h4>
<p>Yeah AFAIK</p>



<a name="204677622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204677622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204677622">(Jul 22 2020 at 15:02)</a>:</h4>
<p>mm, that makes sense</p>



<a name="204677645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204677645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204677645">(Jul 22 2020 at 15:02)</a>:</h4>
<p>I mean, it's very promising and I think it probably will be the eventual model</p>



<a name="204677671"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204677671" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204677671">(Jul 22 2020 at 15:02)</a>:</h4>
<p>But there's been no RFC yet to make that official</p>



<a name="204677724"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204677724" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204677724">(Jul 22 2020 at 15:03)</a>:</h4>
<p>There's also a much bigger focus on getting compile time improvements from mir-opts than runtime performance (in general).</p>



<a name="204677770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204677770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204677770">(Jul 22 2020 at 15:03)</a>:</h4>
<p>We generally don't get a lot of complaints about runtime performance especially in comparison to compile time performance.</p>



<a name="204677924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204677924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204677924">(Jul 22 2020 at 15:04)</a>:</h4>
<p>Right, right</p>



<a name="204678029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204678029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204678029">(Jul 22 2020 at 15:05)</a>:</h4>
<p>I mean I've heard from people running debug builds in production, happy with runtime performance, only to be blown away by the <em>actual</em> runtime performance of their program after recompiling to release mode</p>



<a name="204678162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204678162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204678162">(Jul 22 2020 at 15:06)</a>:</h4>
<p>Yeah, that's always amusing.</p>



<a name="204678223"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204678223" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204678223">(Jul 22 2020 at 15:06)</a>:</h4>
<p>Some of us come from ecosystems where <code>Release</code> mode is +30% or something. Not 100x faster.</p>



<a name="204682174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204682174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lzutao <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204682174">(Jul 22 2020 at 15:33)</a>:</h4>
<p><span class="user-mention silent" data-user-id="212698">Félix Fischer</span> <a href="#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/what.20mir-opts.20matter.3F/near/204676044">said</a>:</p>
<blockquote>
<p>Anywho, I'm super excited for this work. Having noalias actually work in LLVM could bring Rust code beyond C performance in many, many use cases</p>
</blockquote>
<p>Not without fixing <a href="https://github.com/rust-lang/rust/issues/74183">#74183</a>. Pattern matching is used quite a lot in Rust code.</p>



<a name="204687318"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204687318" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Félix Fischer <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204687318">(Jul 22 2020 at 16:11)</a>:</h4>
<p>Oh wow. Fair enough.</p>
<p>Although you could say that both are needed :P</p>



<a name="204787153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204787153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204787153">(Jul 23 2020 at 12:01)</a>:</h4>
<p>there's still some very interesting theoretical open questions here -- what exactly are LLVM's new noalias semantics (once they materialize), and can we relate them formally to Stacked Borrows?</p>



<a name="204787325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/189540-t-compiler/wg-mir-opt/topic/what%20mir-opts%20matter%3F/near/204787325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/189540-t-compiler/wg-mir-opt/topic/what.20mir-opts.20matter.3F.html#204787325">(Jul 23 2020 at 12:03)</a>:</h4>
<p>looks like at some point I'll have to look for coauthors with LLVM experience to make that a paper ;)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>